#include"FrequencyTable.h"

FrequencyTable::FrequencyTable()
{
	reflesh();
}

FrequencyTable::FrequencyTable(map<char, int>& input)
{
	map<char,int>::iterator i;
	for(i = input.begin(); i != input.end(); ++i)
		m_table[i->first] = i->second;
	reflesh();
}

int FrequencyTable::GetFrequency(char c)
{
	return m_table[c];
}

void FrequencyTable::increment(char c)
{
	++m_table[c];
}

void FrequencyTable::reset()
{
	m_table.clear();
}

size_t FrequencyTable::count()
{
	return m_table.size();
}

void FrequencyTable::moveIterator()
{
	++m_pointer;
}

void FrequencyTable::reflesh()
{
	m_pointer = m_table.begin();
}

char FrequencyTable::getCurrentChar()
{
	return m_pointer->first; 
}

unsigned FrequencyTable::getCurrentNum()
{
	return m_pointer->second;
}